Add libgsystem as git external
authorColin Walters <walters@verbum.org>
Sun, 15 Jul 2012 15:51:57 +0000 (11:51 -0400)
committerColin Walters <walters@verbum.org>
Sun, 15 Jul 2012 15:59:05 +0000 (11:59 -0400)
Don't replace ot_lfree and stuff yet though...to much code churn.

.gitmodules [new file with mode: 0644]
Makefile-daemon.am
Makefile-libostree.am
Makefile-ostadmin.am
Makefile-ostree.am
Makefile-otutil.am
Makefile.am
src/libgsystem [new submodule]
src/libotutil/ot-local-alloc.c [deleted file]
src/libotutil/ot-local-alloc.h

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..f456a14
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "src/libgsystem"]
+       path = src/libgsystem
+       url = git://git.gnome.org/libgsystem
index caa97f2e38f432890697d7a0cce5c56507fee25c..aab7e408c1e1d226117e4831ac8ee7e07760c86a 100644 (file)
@@ -24,5 +24,5 @@ ostreed_SOURCES = src/daemon/ostreed.c \
        src/daemon/ot-daemon.c \
        $(NULL)
 
-ostreed_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/daemon -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+ostreed_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/daemon -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
 ostreed_LDADD = libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)
index 2d2b3b228afe14057cf2b6c033bb5e992c39b196..89e7b191bbc232a036ef6db787c8dfef9f380522 100644 (file)
@@ -46,7 +46,7 @@ libostree_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \
        $(NULL)
 endif
 
-libostree_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+libostree_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
 libostree_la_LDFLAGS = -avoid-version -Bsymbolic-functions
 libostree_la_LIBADD = libotutil.la $(OT_INTERNAL_GIO_UNIX_LIBS)
 
index f0e01127867eb85ffea7de03c414576464868e07..16eca4287028ec3b11db28506ac7b9dd13e7277a 100644 (file)
@@ -25,5 +25,5 @@ ostadmin_SOURCES = src/ostadmin/main.c \
        src/ostadmin/ot-admin-main.c \
        $(NULL)
 
-ostadmin_CFLAGS =  $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostadmin -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
-ostadmin_LDADD = libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)
+ostadmin_CFLAGS =  $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostadmin -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+ostadmin_LDADD = libgsystem.la libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)
index b5b07b44030ff45d77978cc3942d9aa691931eb2..9571e5eba547680b7ab74d4b80caf09a95bf463d 100644 (file)
@@ -43,7 +43,7 @@ ostree_SOURCES = src/ostree/main.c \
        src/ostree/ot-main.c \
        $(NULL)
 
-ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree  -DLOCALEDIR=\"$(datadir)/locale\"
+ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree  -DLOCALEDIR=\"$(datadir)/locale\"
 ostree_bin_shared_ldadd = libotutil.la libostree.la
 
 ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS)
index cf7c50e2b068aee84694beeb6084472256d1d949..5d8871625a18692e5ad19fbec96d9bd5c7995423 100644 (file)
@@ -22,7 +22,6 @@ noinst_LTLIBRARIES += libotutil.la
 libotutil_la_SOURCES = \
        src/libotutil/ot-checksum-utils.c \
        src/libotutil/ot-checksum-utils.h \
-       src/libotutil/ot-local-alloc.c \
        src/libotutil/ot-local-alloc.h \
        src/libotutil/ot-opt-utils.c \
        src/libotutil/ot-opt-utils.h \
@@ -39,5 +38,5 @@ libotutil_la_SOURCES = \
        src/libotutil/otutil.c \
        src/libotutil/otutil.h \
        $(NULL)
-libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
-libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS)
+libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS) libgsystem.la
index ad85e97c11ec6b9af43c5f03d2efa87fa9d25f5b..101dec6a260515d47e114c474377eeb8d2fd4740 100644 (file)
@@ -68,6 +68,10 @@ OT_INTERNAL_SOUP_CFLAGS = $(OT_DEP_SOUP_CFLAGS)
 OT_INTERNAL_SOUP_LIBS = $(OT_DEP_SOUP_LIBS)
 endif
 
+libgsystem_srcpath := src/libgsystem
+libgsystem_cflags = $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+libgsystem_libs = $(OT_INTERNAL_GIO_UNIX_LIBS)
+include src/libgsystem/Makefile-libgsystem.am
 include Makefile-daemon.am
 include Makefile-otutil.am
 include Makefile-libostree.am
diff --git a/src/libgsystem b/src/libgsystem
new file mode 160000 (submodule)
index 0000000..ba5d748
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit ba5d74802c0ffe51bd18d2ba64db87e1e7456349
diff --git a/src/libotutil/ot-local-alloc.c b/src/libotutil/ot-local-alloc.c
deleted file mode 100644 (file)
index cf1dba3..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright (C) 2012 Colin Walters <walters@verbum.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Colin Walters <walters@verbum.org>
- */
-
-#include "config.h"
-
-#include "otutil.h"
-
-void
-ot_local_free (void *loc)
-{
-  void **location = loc;
-  if (location)
-    g_free (*location);
-}
-
-#define _ot_local_free(type, function) do {           \
-    void **location = loc;                            \
-    if (location)                                     \
-      {                                               \
-        type *value = *location;                      \
-        if (value)                                    \
-          function (value);                           \
-      }                                               \
-  } while (0)
-
-void
-ot_local_obj_unref (void *loc)
-{
-  GObject **location = (GObject**)loc;
-  if (location && *location)
-    g_object_unref (*location);
-}
-
-void
-ot_local_variant_unref (GVariant **loc)
-{
-  if (loc && *loc)
-    g_variant_unref (*loc);
-}
-
-void
-ot_local_ptrarray_unref (GPtrArray **loc)
-{
-  if (loc && *loc)
-    g_ptr_array_unref (*loc);
-}
-
-void
-ot_local_hashtable_unref (GHashTable **loc)
-{
-  if (loc && *loc)
-    g_hash_table_unref (*loc);
-}
index 3cbfc528dd5d56c788b15b6ca80be5e04b518c7f..ee3b93f4cef1be5585589daa964a5e345eaf3fab 100644 (file)
 #define __OSTREE_LOCAL_ALLOC_H__
 
 #include <gio/gio.h>
+#include "libgsystem.h"
 
 G_BEGIN_DECLS
 
-void ot_local_free (void *loc);
-void ot_local_obj_unref (void *loc);
-void ot_local_variant_unref (GVariant **loc);
-void ot_local_ptrarray_unref (GPtrArray **loc);
-void ot_local_hashtable_unref (GHashTable **loc);
-
-#define ot_lfree __attribute__ ((cleanup(ot_local_free)))
-#define ot_lobj __attribute__ ((cleanup(ot_local_obj_unref)))
-#define ot_lvariant __attribute__ ((cleanup(ot_local_variant_unref)))
-#define ot_lptrarray __attribute__ ((cleanup(ot_local_ptrarray_unref)))
-#define ot_lhash __attribute__ ((cleanup(ot_local_hashtable_unref)))
+#define ot_lfree __attribute__ ((cleanup(gs_local_free)))
+#define ot_lobj __attribute__ ((cleanup(gs_local_obj_unref)))
+#define ot_lvariant __attribute__ ((cleanup(gs_local_variant_unref)))
+#define ot_lptrarray __attribute__ ((cleanup(gs_local_ptrarray_unref)))
+#define ot_lhash __attribute__ ((cleanup(gs_local_hashtable_unref)))
 
 G_END_DECLS